#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QToolBar>
MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QToolBar* toolbar1 = new QToolBar();
    QToolBar* toolbar2 = new QToolBar();
    this->addToolBar(toolbar1);
    this->addToolBar(Qt::LeftToolBarArea, toolbar2);
    QAction* action1 = new QAction("工具1");
    QAction* action2 = new QAction("工具2");
    QAction* action3 = new QAction("工具3");
    QAction* action4 = new QAction("工具4");
    toolbar1->addAction(action1);
    toolbar1->addAction(action2);
    toolbar2->addAction(action3);
    toolbar2->addAction(action4);
    toolbar2->setAllowedAreas(Qt::LeftToolBarArea | Qt::RightToolBarArea);
    toolbar1->setMovable(false);
    toolbar2->setFloatable(false);
}

MainWindow::~MainWindow()
{
    delete ui;
}

